$(document).ready(function () {

    var slideBanner1 = new slideBanner($("#bannerContent"));



    $('.retop .retopb').click(function(){
        $(document).scrollTop(0);
    });

    $('.retop .retopb').mouseover(function(){
        $('.retop').css('background',"url('http://images.jmyzhuang.com/Public/new/2017/07/retopac.jpg') no-repeat");
    }).mouseleave(function(){
        $('.retop').css('background',"url('http://images.jmyzhuang.com/Public/new/2017/07/retop.jpg') no-repeat");
    });
    $('.zxlc ul.zxlctop li').mouseover(function(){
        $('.zxlc ul.zxlcbot a').removeClass('activ');
        var index = $(this).index();
        aindex = index*2;
        $('.zxlc ul.zxlcbot li:eq('+aindex+') a').addClass('activ');
    });
    $('.zxlc ul.zxlcbot a').mouseover(function(){
        $('.zxlc ul.zxlcbot a').removeClass('activ');
        $(this).addClass('activ');
    });
    $('.zxlc').mouseleave(function(){
        $('.zxlc ul.zxlcbot a').removeClass('activ');
    });
    var k = new Swiper(".design-swiper", {
        "slidesPerView": "auto",
        "loop": !0,
        "loopedSlides": 2,
        "simulateTouch": !1,
        "offsetPxBefore": $(window).width() < 1440 ? 510 : 725,
        "onInit": function (e) {
            e.swipeTo(3), s()
        }
    });
    function e() {
        var e = $(".banner-sliders .swiper-slide").find("__PUBLIC__/app/img");
        $(e).each(function (e) {
            var t = this, n = new Image;
            n.onload = function () {
                var e = $(t).width() / 2;
                $(t).css({"marginLeft": "-" + e + "px", "display": "block"})
            }, n.src = $(t)[0].src
        })
    }
    function s() {
        var e = $(".design-topic .swiper-slide-active").data("index");
        $(".design-topic").find(".design-info").hide(), $(".design-topic").find(".design-info").each(function () {
            if ($(this).data("index") == e) return void $(this).show()
        })
    }
    function c() {
        var e = $(window).width() < 1440 ? 50 : 62,
            t = $(".design-swiper .swiper-wrapper").css("padding-left").split("px")[0] - e,
            n = $(".design-topic .design-info").width(), i = t + 10 + e;
        $(".design-topic .arrow-left").css({"left": t - 10}), $(".design-topic .arrow-right").css({"left": i}), $(".design-topic .design-info").css({"left": i - n - 120}), $(".design-swiper,.design-topic").show()
    }
    $(".design-topic .arrow-left").click(function () {
        k.swipePrev(), $(".design-swiper").find(".swiper-slide").eq(0).hasClass("swiper-slide-active") && k.swipePrev(), s()
    }), $(".design-topic .arrow-right").click(function () {
        k.swipeNext(), s()
    }), c(), $(window).resize(function () {
        clearTimeout(e);
        var e = setTimeout(function () {
            c()
        }, 0)
    });
    $('.xzxk .xzx1').mouseover(function () {
        $('.xzxk .xzx1').find(".tit-lower").show();
        $('.xzxk .xzx1').find(".tit-upper").hide();
        $('.xzxk .xzx1').find(".xzxul li:first").show();
        $('.xzxk .xzx1').find('.xzxdl').hide();
        $('.xzxk .xzx1').removeClass("hover");


        $(this).find(".tit-lower").hide();
        $(this).find(".tit-upper").show();
        $(this).find(".xzxul li:first").hide();
        $(this).find('.xzxdl').show();
        $(this).addClass("hover");
        $('.xzxk').attr('data', $(this).index());

    });

})